home *** CD-ROM | disk | FTP | other *** search
- Path: gryphon.phoenix.net!usenet
- From: brucew@phoenix.net (Bruce Wedding)
- Newsgroups: comp.lang.c
- Subject: Re: Linker ERROR: BC4 -- HELP!!!
- Date: Wed, 17 Jan 1996 05:20:30 GMT
- Organization: BranPaul Systems
- Message-ID: <4dhul3$3fb@gryphon.phoenix.net>
- References: <4denut$2k9@lastactionhero.rs.itd.umich.edu>
- NNTP-Posting-Host: dial110.phoenix.net
- X-Newsreader: Moe's Newsreader
-
- mschunde@umich.edu (Mark Schunder) wrote:
-
- >Linker Error: _uiKey defined in module KEYBOARD.C is duplicated in
- >module MAIN.C
-
- >KeybTaskHandle and uiKey are suppose to be global varaibles. uiKey is
- >accessed by two different c files : Keyboard.c (this file updates
- >uiKey with the ascii when the user presses a key on the keyboard) and
- >main.c (this file monitors uiKey, when it changes, it repaints the
- >screen according to the value of uiKey).
- >
- >I do not know why I'm getting these errors. I have the keyboard.c
- >header file included in both KEYBOARD.c and MAIN.C (so both sets of
- >files can see the variable and read and update the variables
- >accordingly).
-
- It sounds like you have defined the global in a header file. That is
- poor style. Define the global in one module, preferably global.c if
- this is a large project, and then declare it extern in the header
- file that is included with every other module that used it.
-
- Bruce D. Wedding Have Compiler, Will Travel!
- Perspicacious Programming Performed Promptly
- Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
-
-